<?php  # Script -- getuser.php

/* Author @ Huoty
 *   Date @ 2015-02-12 11:18:17
 *  Brief @ 
 */

$q=$_GET["q"];

$con = mysqli_connect('localhost','root','123456','testdb');
if (!$con)
{
die('Could not connect: ' . mysqli_error($con));
}

mysqli_select_db($con,"kong_ajaxdemo");
$sql="SELECT * FROM kong_ajaxdemo WHERE id = '".$q."'";

$result = mysqli_query($con,$sql);

echo "<table border='1'>
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Age</th>
<th>Hometown</th>
<th>Job</th>
</tr>";

while($row = mysqli_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['FirstName'] . "</td>";
echo "<td>" . $row['LastName'] . "</td>";
echo "<td>" . $row['Age'] . "</td>";
echo "<td>" . $row['Hometown'] . "</td>";
echo "<td>" . $row['Job'] . "</td>";
echo "</tr>";
}
echo "</table>";

mysqli_close($con);

?>
